package com.lrkj.back.service.impl;

import java.util.List;
import java.util.Map;

import com.lrkj.back.entity.ZsWanglanpackage;
import com.lrkj.back.mapper.ZsWanglanpackageMapper;
import com.lrkj.back.service.ZsWanglanpackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service
public class ZsSWanglanpackServiceImpl extends ParentServiceImpl<ZsWanglanpackage> implements ZsWanglanpackageService {
    @Autowired
    private ZsWanglanpackageMapper zsWlpackMapper;

    @Override
    protected DBInterface<ZsWanglanpackage> getDao() throws DBException {
        return zsWlpackMapper;
    }

    @Override
    public PageInfo<ZsWanglanpackage> findAllWlpackList(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsWanglanpackage> list = zsWlpackMapper.findAllWlpack(map);
        PageInfo<ZsWanglanpackage> zsWanglan = new PageInfo<ZsWanglanpackage>(list);
        return zsWanglan;
    }

    @Override
    public int updateBatch(List<ZsWanglanpackage> list) throws DBException {
        return zsWlpackMapper.updateBatch(list);
    }

    @Override
    public int insertBatch(List<ZsWanglanpackage> list) throws DBException {
        return zsWlpackMapper.insertBatch(list);
    }

    @Override
    public int deleteBatch(List<String> list) throws DBException {
        return zsWlpackMapper.deleteBatch(list);
    }

    @Override
    public int deleteByPackageTiaomaArr(List<String> list) throws DBException {
        return zsWlpackMapper.deleteBatch(list);
    }



    @Override
    public List<ZsWanglanpackage> findAllWlpackListNoPage(Map<String, Object> map) throws DBException {

        return zsWlpackMapper.findAllWlpack(map);
    }

    @Override
    public List<ZsWanglanpackage> selectByPackageTiaoma(String tiaoma) throws DBException {
        return zsWlpackMapper.selectByPackageTiaoma(tiaoma);
    }

}
